/*
 * Copyright (c) 2025, 廖树财, <study_2030@163.com>
 *
 * PES1.0.3-YCYW is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2     
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
#ifndef _BUSSINESS_TERMINAL_MANAGER_
#define _BUSSINESS_TERMINAL_MANAGER_


// int TerminalManage(int test);
/// requst/response
int terminalSyncTime(char *pcJson);            // 终端校时
int terminalReboot(char *pcJson);              // 终端重启
int terminalSetDataReportConfig(char *pcJson); // 采样频率、上报频率设置
int terminalcallLinkTrace(char *pcJson);       // 链路追踪
int terminalprocessCmd(char *pcJson);          // 全量上报指令下发
int terminaldataSpaceService(char *pcJson);    // 磁盘重新获取指令下发
int terminalManageConf(char *pcJson);
int addMqttIpPort(char *pcJson);
int eagleEyeInit(char *pcJson);
int terminalUsbPlugging(char *pcJson);
int terminalStartDepend(char *pcJson);
int terminalUpdateCer(char *pcJson);
int realTimeMonitoring(char* pcJson);
int terminalSubDeviceAuth(char *pcJson);
//第三方模块
int ThirdModuleMain(char *pcJson);  
//载波网管模块
int PlcModuleMain(char* pcJson);
/// 上报
int terminalManage(char *ciMid, char *deviceSn);        // 系统基本信息上报，上报频率：程序启动后上报一次
int terminalcpuTemp(char *ciMid, char *deviceSn);       // CPU温度数据上报
int terminalcpuUsage(char *ciMid, char *deviceSn);      // CPU使用率数据上报
int terminalmemUsage(char *ciMid, char *deviceSn);      // 内存使用率数据上报
int terminaldiskUsage(char *ciMid, char *deviceSn);     // 磁盘使用率数据上报
int terminalLTEModule(char *ciMid, char *deviceSn);     // 无线网数据上报
int terminaletherModule(char *ciMid, char *deviceSn);   // 有线网数据上报
int terminalDataSpace(char *ciMid, char *deviceSn);     // 系统运行数据上报
int terminalNetLinkStatus(char *ciMid, char *deviceSn); // 系统运行数据上报
int terminalprocessEvent(char *ciMid, char *deviceSn, int now);
int terminalserviceEvent(char *ciMid, char *deviceSn, int now);
int terminalContainerRuntimeData(char *ciMid, char *deviceSn);    // 容器运行数据上报
int terminalAppRuntimeData(char *ciMid, char *deviceSn, int now); // 微应用运行数据上报


/// 封装所有主动上报总入口
int terminalManageBaseInfo(); // 系统基本信息上报，上报频率：程序启动后上报一次
int terminalRuntimeData();    // 系统运行数据上报
/// losscallback
int terminalLoss();
int terminalSend();
#endif

int update_app_status_pthread(char* pJson);

int update_process_status_pthread(char* pJson);

int update_service_status_pthread(char* pJson);

//服务启动线程,包括服务启动和状态更新
void* service_start_stop_pthread(void* arg);

int check_and_report_iot_changes();


int terminalQueryMqttScram(char *pcJson);

